import React, { Component } from "react";
import "./App.css";
import { Switch, Route, Redirect } from "react-router-dom";
import { Provider } from "mobx-react";
import BuyGoods from "./pages/BuyGoods";
import RootStore from "./stores/index";

export class App extends Component {

  render() {
    return (
      <Provider {...new RootStore()}>
        {/* Switch 匹配Route下的path路径，如果有一个满足，则后面的就不继续匹配了 */}
        <Switch>
          <Route path="/BuyGoods" component={BuyGoods}></Route>
          {/* Redirect 如果前面的 path 路径不匹配，则重定向到 to='/login'路径 */}
          <Redirect to="/BuyGoods"></Redirect>
        </Switch>
      </Provider>
    );
  }
}

export default App;
